package cn.com.connext.scrm.service;

import cn.com.connext.scrm.domain.master.ErpLogistics;
import cn.com.connext.scrm.repository.master.ErpLogisticsRepository;
import cn.com.connext.scrm.service.dto.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

//import cn.com.connext.scrm.repository.master.ErpLogisticsRepository;


@Service
@Transactional
public class ErpLogisticsService {

    @Autowired
    private ErpLogisticsRepository erpLogisticsRepository;

    public JsonResult save(List<ErpLogistics> list) {
        JsonResult result =new JsonResult();
        erpLogisticsRepository.save(list);
        result.setMessage("添加成功");
        return result;
    }

    /**
     * 新增一条erp信息
     * @param erpLogistics
     */
    public void saveOne(ErpLogistics erpLogistics){
        erpLogisticsRepository.saveAndFlush(erpLogistics);
    }

}
